package com.ls.springbootdemo.service.impl;

import com.github.pagehelper.Page;
import com.github.pagehelper.PageHelper;
import com.ls.springbootdemo.mapper.UserMapper;
import com.ls.springbootdemo.model.User;
import com.ls.springbootdemo.service.PageService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author 挥之以墨
 */
@Service
public class PageServiceImpl implements PageService {

    @Autowired
    private UserMapper userMapper;

    @Override
    public List<User> queryUser() {
        Page<User> users = PageHelper.startPage(1, 2);
        userMapper.selectAll();
        return users;
    }
}
